try:
    f = open("C:/abc.txt","r",encoding="utf-8")
except Exception as e:
    print("出现了异常了")
    f = open("C:/abc.txt","w",encoding="utf-8")
else:
    print("好，没有异常")
finally:
    print("我是finally,有没有异常我都要执行")
    f.close()